package xyz.csmemo.novel.service.impl;

import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import xyz.csmemo.novel.core.common.resp.RestResp;
import xyz.csmemo.novel.dto.resp.HomeBookRespDto;
import xyz.csmemo.novel.dto.resp.HomeFriendLinkRespDto;
import xyz.csmemo.novel.manager.cache.FriendLinkCacheManager;
import xyz.csmemo.novel.manager.cache.HomeBookCacheManager;
import xyz.csmemo.novel.service.HomeService;

import java.util.List;

@Service
@RequiredArgsConstructor
public class HomeServiceImpl implements HomeService {
    private final HomeBookCacheManager homeBookCacheManager;

    private final FriendLinkCacheManager friendLinkCacheManager;
    @Override
    public RestResp<List<HomeBookRespDto>> listHomeBooks() {
        return RestResp.ok(homeBookCacheManager.listHomeBooks());
    }

    @Override
    public RestResp<List<HomeFriendLinkRespDto>> listHomeFriendLinks() {
        return RestResp.ok(friendLinkCacheManager.listFriendLinks());
    }
}
